<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
</head>
<body>

<h2>内容是数组</h2>
<p>内容是数组会转换为 JavaScript 数组。</p>

<p id="demo"></p>

<script>

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
            myArr = JSON.parse(this.responseText);
            document.getElementById("demo").innerHTML = myArr[1];
        }
    };
    xmlhttp.open("GET", "demo.txt", true);
    xmlhttp.send();

</script>

<p>查看服务端数据 <a href="demo.txt" target="_blank">demo.txt</a></p>

</body>
</html>